<%@ Page Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="TemplateControls.aspx.cs" Inherits="TemplateControls" Title="Untitled Page" %>
<asp:Content ID="Content2" ContentPlaceHolderID="phActions" runat="server">
    <asp:LinkButton ID="btnSave" Text="Save" runat="server" 
        onclick="btnSave_Click" />
    <asp:LinkButton ID="btnCancel" Text="Cancel" runat="server" CausesValidation="false" 
        onclick="btnCancel_Click" />
    <asp:LinkButton ID="btnEdit" Text="Edit" runat="server" CausesValidation="false"
        onclick="btnEdit_Click" />
    <asp:LinkButton ID="btnAdd" Text="Add New" runat="server" CausesValidation="false"
        onclick="btnAdd_Click" />
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="phMain" Runat="Server">
<fieldset>
    <legend>Current Template Controls</legend>
    <asp:GridView ID="gvTemplateControls" runat="server" 
        AutoGenerateColumns="False" DataSourceID="dsControls" 
        DataKeyNames="Id,ConcurencyId" 
        SelectedIndex="-1"
        onselectedindexchanged="gvTemplateControls_SelectedIndexChanged">
        <Columns>
            <acms:IndexField />
            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
            <asp:BoundField DataField="Notes" HeaderText="Notes" />
            <acms:CommandField ButtonType="Link" CommandName="Select" Text="Select" />
            <acms:CommandField ButtonType="Link" CommandName="Delete" Text="Delete" ConfirmMessage="Are you sure you want to delete this content control?" />
        </Columns>
    </asp:GridView>
</fieldset>
<fieldset id="details" visible="false" runat="server">
    <legend id="legend" runat="server">Add New Template Controls</legend>
    <asp:DetailsView ID="dvTemplateControls" runat="server" 
        AutoGenerateRows="False" DataSourceID="dsControls" 
        DataKeyNames="Id,ConcurencyId" 
        onitemupdated="dvTemplateControls_ItemUpdated" 
        oniteminserted="dvTemplateControls_ItemInserted">
        <Fields>
            <acms:TextBoxField DataField="Name" Required="true" HeaderText="Name" SortExpression="Name" />
            <asp:BoundField DataField="AdminControlType" HeaderText="Admin Control Type" SortExpression="AdminControlType" />
            <acms:TextBoxField Width="500" Required="true" DataField="AdminDisplayControlType" HeaderText="Admin Display" SortExpression="AdminDisplayControlType" />
            <acms:TextBoxField Width="500" Required="true" DataField="AdminEditControlType" HeaderText="Admin Edit" SortExpression="AdminEditControlType" />
            <acms:TextBoxField Width="500" Required="true" DataField="FrontEndControlType" HeaderText="Front End" SortExpression="FrontEndControlType" />
            <acms:TextAreaField Cols="100" Rows="10" DataField="Notes" HeaderText="Notes" SortExpression="Notes" />
        </Fields>
    </asp:DetailsView>
</fieldset>
<acms:ControlTypeDataSource ID="dsControls" runat="server" OnSelectData="dsControls_SelectData" OnUpdatingData="dsControls_UpdatingData" />
</asp:Content>

